package com.veo.service.Impl;

import com.veo.dao.ReaderDao;
import com.veo.entity.User;
import com.veo.service.ReaderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate5.support.HibernateDaoSupport;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Service("readerService")
@Transactional()
public class ReaderServiceImpl extends HibernateDaoSupport implements ReaderService {

    @Autowired
    private ReaderDao readerDao;


    @Override
    public List<User> getAllReader() {
        return readerDao.getAllReader();
    }

    @Override
    public void deleteReader(User reader) {
        readerDao.deleteReader(reader);

    }

    @Override
    public void addReader(User reader) {
        readerDao.addReader(reader);

    }

    @Override
    public void updateReader(User reader) {
        readerDao.updateReader(reader);

    }

    @Override
    public boolean findIdCacr(User reader) {
        return readerDao.findIdCacr(reader);
    }

    @Override
    public boolean findUsername(User reader) {
        return readerDao.findUsername(reader);
    }

}
